<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>商品列表 </title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="/admin/Styles/general.css" rel="stylesheet" type="text/css" />
<link href="/admin/Styles/main.css" rel="stylesheet" type="text/css" />
</head>
<body>
<h1>
    <span class="action-span"><a href="{{url('manager/goods/create')}}">添加新商品</a></span>
    <span class="action-span1"><a href="{{url('manager/main')}}">ECSHOP 管理中心</a></span>
    <span id="search_id" class="action-span1"> - 商品列表 </span>
    <div style="clear:both"></div>
</h1>
<div class="form-div">
    <form action="" name="searchForm">
        <img src="/admin/images/icon_search.gif" width="26" height="22" border="0" alt="search" />
        <!-- 分类 -->
        <select name="cat_id">
            <option value="0">所有分类</option>
            @foreach($cat as $v)
            <option value="{{$v->cat_id}}">{{str_repeat('└',$v->level)}}{{$v->cat_name}}</option>
                @endforeach

        </select>
        <!-- 品牌 -->
        <select name="brand_id">
            <option value="0">所有品牌</option>
            @foreach($brand as $v)
            <option value="{{$v->brand_id}}">{{$v->brand_name}}</option>
            @endforeach
        </select>
        <!-- 推荐 -->
        <select name="intro_type">
            <option value="0">全部</option>
            <option value="is_best">精品</option>
            <option value="is_new">新品</option>
            <option value="is_hot">热销</option>
        </select>
        <!-- 上架 -->
        <select name="is_on_sale">
            <option value=''>全部</option>
            <option value="1">上架</option>
            <option value="0">下架</option>
        </select>
        <!-- 关键字 -->
        关键字 <input type="text" name="keyword" size="15" />
        <input type="submit" value=" 搜索 " class="button" />
    </form>
</div>

<!-- 商品列表 -->
<form method="post" action="" name="listForm" onsubmit="">
    <div class="list-div" id="listDiv">
        <table cellpadding="3" cellspacing="1">
            <tr>
                <th>编号</th>
                <th>商品名称</th>
                <th>货号</th>
                <th>价格</th>
                <th>精品</th>
                <th>新品</th>
                <th>热销</th>
                <th>库存</th>
                <th>预览</th>
                <th>操作</th>
            </tr>
            {{--遍历商品列表开始--}}
            @forelse($data as $goods)
            <tr>
                <td align="center">{{$goods->goods_id}}</td>
                <td align="center" class="first-cell"><span>
                    {{$goods->goods_name}}
                </span></td>
                <td align="center"><span>
                    {{$goods->goods_sn}}
                </span></td>
                <td align="center">
                    {{$goods->shop_price}}
                </td>
                <td align="center">
                    @if($goods->is_best)
                    是
                    @else
                    否
                    @endif
                </td>
                <td align="center">
                    @if($goods->is_new)
                    是
                    @else
                    否
                    @endif
                </td>
                <td align="center">
                    @if($goods->is_hot)
                    是
                    @else
                    否
                    @endif
                </td>
                <td align="center"><span>{{$goods->goods_number}}</span></td>
                <td align="center"><span><a href="#">预览</a></span></td>
                <td align="center">
                    <a href="{{url('manager/goods')}}/{{$goods->goods_id}}/edit" title="编辑">
    					<img src="/admin/images/icon_edit.gif" width="16" height="16" border="0" />
    				</a>
                    <a onclick="return confirm('真的要添加到回收站吗?')" href="{{url('manager/goodsToRecycle',$goods->goods_id)}}" title="回收站">
    					<img src="/admin/images/icon_trash.gif" width="16" height="16" border="0" />
    				</a>
				</td>
            </tr>
            @empty
            <div style="text-align:center">暂无商品信息!</div>
            @endforelse
            {{--遍历商品列表结束--}}
        </table>

    <!-- 分页开始 -->
        @include('layouts.page')
    <!-- 分页结束 -->
    </div>
</form>
<div id="footer">
</div>
</body>
</html>